{"ast":null,"code":"import _regeneratorRuntime from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _classCallCheck from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";import apiClient from\"../http\";import{deleteContent as _deleteContent,uploadImage as _uploadImage,uploadFile as _uploadFile}from\"../routes\";var ContentService=/*#__PURE__*/function(){function ContentService(){_classCallCheck(this,ContentService);}_createClass(ContentService,null,[{key:\"deleteContent\",value:function(){var _deleteContent2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(data){return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt(\"return\",apiClient.delete(_deleteContent(data.id||'0')));case 1:case\"end\":return _context.stop();}}},_callee);}));function deleteContent(_x){return _deleteContent2.apply(this,arguments);}return deleteContent;}()},{key:\"uploadImage\",value:function(){var _uploadImage2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file){return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:return _context2.abrupt(\"return\",apiClient.post(_uploadImage(),file));case 1:case\"end\":return _context2.stop();}}},_callee2);}));function uploadImage(_x2){return _uploadImage2.apply(this,arguments);}return uploadImage;}()},{key:\"uploadFile\",value:function(){var _uploadFile2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(file){return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:return _context3.abrupt(\"return\",apiClient.post(_uploadFile(),file));case 1:case\"end\":return _context3.stop();}}},_callee3);}));function uploadFile(_x3){return _uploadFile2.apply(this,arguments);}return uploadFile;}()}]);return ContentService;}();export{ContentService as default};","map":{"version":3,"names":["apiClient","deleteContent","uploadImage","uploadFile","ContentService","data","delete","id","file","post"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/services/ContentService.ts"],"sourcesContent":["import apiClient from \"../http\";\nimport {AxiosResponse} from 'axios';\nimport {deleteContent, uploadImage, uploadFile} from \"../routes\"\nimport {ContentListItem} from \"../models/response/ContentListItem\";\nimport {DeleteContentResponse} from \"../models/response/Other/DeleteContentResponse\";\n\nexport default class ContentService {\n\n    public static async deleteContent(data: ContentListItem): Promise<AxiosResponse<DeleteContentResponse>> {\n        return apiClient.delete<DeleteContentResponse>(deleteContent(data.id || '0'));\n    }\n\n    public static async uploadImage(file: FormData): Promise<AxiosResponse<ContentListItem>> {\n        return apiClient.post(uploadImage(), file);\n    }\n\n    public static async uploadFile(file: FormData): Promise<AxiosResponse<ContentListItem>> {\n        return apiClient.post(uploadFile(), file);\n    }\n}"],"mappings":"skBAAA,MAAOA,UAAS,KAAM,SAAS,CAE/B,OAAQC,aAAa,GAAbA,eAAa,CAAEC,WAAW,GAAXA,aAAW,CAAEC,UAAU,GAAVA,YAAU,KAAO,WAAW,IAI3CC,eAAc,+OAE/B,iBAAkCC,IAAqB,oJAC5CL,SAAS,CAACM,MAAM,CAAwBL,cAAa,CAACI,IAAI,CAACE,EAAE,EAAI,GAAG,CAAC,CAAC,wDAChF,sNAED,kBAAgCC,IAAc,yJACnCR,SAAS,CAACS,IAAI,CAACP,YAAW,EAAE,CAAEM,IAAI,CAAC,0DAC7C,+MAED,kBAA+BA,IAAc,yJAClCR,SAAS,CAACS,IAAI,CAACN,WAAU,EAAE,CAAEK,IAAI,CAAC,0DAC5C,iIAZgBJ,cAAc"},"metadata":{},"sourceType":"module"}